package cc.yaomm.common.biz.enums;

import cc.yaomm.common.basic.base.SuperEnum;
import com.baomidou.mybatisplus.annotation.EnumValue;
import com.google.common.collect.Sets;
import lombok.Getter;

import java.util.Set;

/**
 * 系统类型
 */
@Getter
public enum SystemEnum implements SuperEnum<SystemEnum, String> {

    BIZ("BIZ", "业务系统", Sets.newHashSet(UserTypeEnum.BIZ)),

    SHOP("SHOP", "商家端", Sets.newHashSet(UserTypeEnum.SHOP)),

    PC("PC", "用户端", Sets.newHashSet(UserTypeEnum.GENERAL)),

    APP("APP", "移动端", Sets.newHashSet(UserTypeEnum.GENERAL)),

    GROUP("GROUP", "集团系统", Sets.newHashSet(UserTypeEnum.GROUP, UserTypeEnum.GROUP_SON));

    @EnumValue
    private String value;

    private String name;

    private Set<UserTypeEnum> userType;

    SystemEnum(String value, String name, Set<UserTypeEnum> userType) {
        this.value = value;
        this.name = name;
        this.userType = userType;
    }

    @Override
    public SystemEnum[] enums() {
        return values();
    }

}
